<?php

import('classes.handler.Handler');
class SSTKHandler extends Handler {
    function SS_TK($args, &$request) {
		// chua dung den

        $gcNam = Request::getUserVar('xNam') ;
        $xSection = Request::getUserVar("ChiTiet") ;
        $xDay  = Request::getUserVar("dateExpire1Day");
        $xMonth  = Request::getUserVar("dateExpire1Month");

        $xDay2  = Request::getUserVar("dateExpire2Day");
        $xMonth2  = Request::getUserVar("dateExpire2Month");

        $xmatk = Request::getUserVar("matk");

        $user =& Request::getUser();
        $userId = $user->getId();
        $xma_dvcs = $user->getPath();
        $date1 = mktime(0, 0, 0, $xMonth, $xDay, $gcNam);
        $date2 = mktime(0, 0, 0, $xMonth2, $xDay2, $gcNam);


       // lay so lieu
        $ctktDao =& DAORegistry::getDAO('CTKTDAO');
        $ctkts =& $ctktDao->getCTKT_BC1($gcNam, $date1, $date2, $xmatk);
        //var_dump($ctkts);

        $templateMgr =& TemplateManager::getManager();
        $templateMgr->assign('gcNam', $gcNam);
        $templateMgr->assign('TBC', "So Quy" );
        $templateMgr->assign('ctkts', $ctkts);
        $templateMgr->assign('tencty','Công ty dược TW3');
        $templateMgr->assign('diachi','Địa chỉ: Đà Nẵng');
        $templateMgr->assign('tieude','SỔ QUỸ TIỀN MẶT');
        $templateMgr->assign('loaitk',$xmatk);
        $templateMgr->assign('tbdau',$date1);
        $templateMgr->assign('tkthuc',$date2);
        $templateMgr->assign('section',$xSection);


        $templateMgr->display('acctSS/soquy.tpl');
    }


    function SS_TMTG($args, &$request) {
		$journal =& Request::getJournal();
		$journalid =$journal->getId();;


		$ngay1  = Request::getUserVar("ngay1");
        $ngay2  = Request::getUserVar("ngay2");

		$matk = Request::getUserVar("matk");

        $user =& Request::getUser();
        $userId = $user->getId();

        // lay so lieu
        $ctktDao =& DAORegistry::getDAO('CTKTDAO');
        $ctkts =& $ctktDao->getCTKT_TMTG($journalid, $ngay1, $ngay2, $matk);

		$templateMgr =& TemplateManager::getManager();
        $templateMgr->assign('gcNam', substr($ngay1,6) );
        $templateMgr->assign('TBC', "So Quy" );
        $templateMgr->assign('ctkts', $ctkts);
        $templateMgr->assign('tencty','Công ty dược TW3');
        $templateMgr->assign('diachi','Địa chỉ: Đà Nẵng');
        $templateMgr->assign('tieude','SỔ QUỸ TIỀN MẶT');
        $templateMgr->assign('loaitk',$matk);
        $templateMgr->assign('tbdau',$ngay1);
        $templateMgr->assign('tkthuc',$ngay2);
        $templateMgr->assign('section','sdfdsf');


        $templateMgr->display('acctSS/soquy.tpl');
    }




}

?>
